<?php

header('Content-Type: text/plain');
header('Content-Encoding: UTF-8');
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");

require_once("../../../wp-config.php");

if(function_exists('get_option')) {

$or = get_option('mlang_lang');
$str = "";
for ($i=0;$i<count($or);$i++)
{
	if($i == 0)
		$str = $or[$i]['lang'];
	else
		$str = $str."+".$or[$i]['lang'];
}
$result = explode("+", $str);
} else {
	$d = "Dada: ".WPMLANG_PLUGIN_DIR."-Wooo";
$result = array($d,  "this");
}

$langs = array(
	"id" => $input->id,
	"result" => $result,
	"error" => null);

if(function_exists('json_encode')) {
	echo json_encode($langs);
} else {
	// PHP4 version
	require_once(ABSPATH."/wp-includes/js/tinymce/plugins/spellchecker/classes/utils/JSON.php");
	$json_obj = new Moxiecode_JSON();
	echo $json_obj->encode($langs);
}
?>